package com.refactoring.chapter01;

public abstract class PerformanceCalculator {
    private Performance performance;
    private Play play;

    public PerformanceCalculator(Performance performance, Play play) {
        this.performance = performance;
        this.play = play;
    }

    public abstract int amount();

    public int volumeCredits() {
        // add volume credits
        int result = 0;
        result += Math.max(this.performance.getAudience() - 30, 0);
        return result;
    }

    public Play getPlay() {
        return play;
    }

    public Performance getPerformance() {
        return performance;
    }
}
